Modify directory.watch.added and add directory.watch.removed command #616
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
One of the advantages of using "inotify" to load and remove downloads by torrent meta files is the reduced file system IO (apart from it's instant).
Refers to: #374
A. Modify
directory.watch.added
Allow it to accept multiple commands (as
load.*
commands).There are multiple ways to achieve this but since there's no "shortcut" (the directory (that is watched) for inotify has to be separated), the final command (that is called on an "add" event) is reconstructed as a line of config.
load.*
commands),
parameter separator) then it needs to be included inside quotes ("
)B. Add
directory.watch.removed
Similarly to loading event, add ability to handle removing events of meta files as
*_untied
commands:*_untied
commands can't deal with a download individually: they go through and check all the downloads (they can generate lot of IO, especially if they are used withschedule
command)directory.watch.removed
handles this individuallySince it doesn't need any additional commands, it accepts multiple directories as parameters.
d.stop
,d.close
,d.erase
directory.watch.removed = d.erase, (cat,(cfg.dir.meta_compl),various/), (cat,(cfg.dir.meta_compl),unsafe/)
C. Rename
*tied
commandsRename untied commands and add redirects for the new names to preserve compatibility:
start_tied
->tied.start
stop_untied
->untied.stop
close_untied
->untied.close
remove_untied
->untied.remove
D. Limitations
directory.watch.added
ordirectory.watch.removed
E.
directory.watch.*
commands in actionLet's assume the following: